$(".left_menu_l2,.left_menu_l1" ).each(function(){
		var thiz =this;
		//alert($(this).attr("id"));
		$(thiz).on("click",function(){
			//console.log(".active:" + $(".active").length)
			//移除旧的激活信息。
			$(".active").each(function(){
				$(this).removeClass("active")
			})
			//console.log(".display :" + $("ul[style='display: block;'],  ul[style='display:block;']").length)
			//折叠已经展开的列表
			$(".tpl-left-nav-sub-menu").each(function(){
				$(this).css("display","none");
			})	
			//下尖号改为右尖号
			$(".tpl-left-nav-more-ico-rotate").each(function(){
				$(this).removeClass("tpl-left-nav-more-ico-rotate")
			})
			///重新渲染新的菜单
			$(this).parent().parent().prev().addClass("active")
			$(this).parent().parent().prev().children(".tpl-left-nav-more-ico").addClass("tpl-left-nav-more-ico-rotate");
			$(this).addClass("active")
			$(this).parent().parent().css("display","block");//tpl-left-nav-sub-menu
		})
})
var inteId=-1,iframeHeight=0;
$("#myframe").load(function(){
	if(inteId!=-1)
		clearInterval(inteId)
	inteId=setInterval(function(){
		reinitIframe();
	},200)
	if($("#myframe").attr("findex")!=undefined){
		layer.close($("#myframe").attr("findex"));
	}
	//reinitIframe();
});
window.onresize=function(){  	reinitIframe();	}
function reinitIframe(){
	var iframe = document.getElementById("myframe");
	var newHeight=-1
	try{	
    	//$("#myframe").css("height",)
    	//newHeight=getDocumentPort (iframe.contentWindow.document).height
    	newHeight =iframe.contentWindow.document.body.scrollHeight
    	if(newHeight!=iframeHeight){
    		iframeHeight=iframe.contentWindow.document.body.scrollHeight
    		$("#myframe").css("height",iframeHeight)
    		console.log(iframeHeight);
    	};
	}catch (ex){
		
	}
}
function getDocumentPort (document) {
    if(document.compatMode == "BackCompat") {
    	console.log("BackCompat")
        return {
            width: document.body.scrollWidth,
            height: document.body.scrollHeight
        };
    } else {
        return {
            width: Math.max(document.documentElement.scrollWidth,document.documentElement.clientWidth),
            height: Math.max(document.documentElement.scrollHeight,document.documentElement.clientHeight)
        }
    }
}